<?php
    /**
    * logout.php
    * 
    * @author Osuvaldo Ramos <xdracox@gmail.com>
    * @copyright Copyright (c) 2008, Osuvaldo Ramos
    * @license http://www.opensource.org/licenses/bsd-license.php
    * @package Atman
    */
    
    /**
    * Class to manage the logout application. The logout application logs the
    * current user out.
    * @package Atman
    */
    class logout extends AT_Module
    {
        /**
        * __construct()
        * @param mixed $options Unused.
        */
        public function __construct($options)
        {
            parent::__construct('users');
        }
        
        /**
        * The default event for the logout application logs the user out.
        */
        public function __default()
        {
            $session = AT_Session::singleton();
            $session->set('userID', NULL);
            header('Location: '.AT_SITE_ROOT.'/users/login');
        }
        
        /**
        * __destruct()
        */
        public function __destruct()
        {
            parent::__destruct();
        }
    }
?>
